// import $http from "../utils/axios_test";
import axios from "../utils/axios.js"
// interface login {
//     username: string,
//     password: string
// }
interface finishedOrder {
    "order_id": string,
    status: number
}
// export const login = (data: login) => axios({ method: 'post', url: "http://localhost:8080/foo/login", data }).then(
//     response => {
//         localStorage.setItem('Cusertoken', `Bearer ${response.data.data}`)
//         return response.data
//     },
//     error => {
//         console.log(error);
//     }
// )
export const orderAll = () => axios({ method: 'get', url: "/foo/api/v1/order/getAllOrder" })
export const orderOther = (status: number) => axios({ method: 'post', url: "/foo/api/v1/order/getOrderByKind", data: { status } })
export const finishedOrder = (data:finishedOrder) => axios({ method: 'put', url: '/foo/api/v1/order/updateOrderStatus', data })
export const CreatOrder = (data:finishedOrder) => axios({ method: 'post', url: '/foo/api/v1/order/addOrder', data })
export const payOrder = (data:finishedOrder) => axios({ method: 'put', url: '/foo/api/v1/order/payOrder', data })